{% extends "base.html" %}

{% block greybox %}
{% endblock %}

{% block formJs %}
<script type="text/javascript" src="/js/form.js"></script>
{% endblock %}

{% block js %}

/**
 * Post form data
 */
function postForm() {
    $.ajax({
        url : '/add',
        data : {
            title: $('#contact-title').val(),
            published : $('#contact-published').val(),
            lon : $('#contact-lon').val(),
            lat : $('#contact-lat').val(),
            memo : $('#contact-memo').val()
        },
        type : 'post',
        dataType : 'jsonp',
        complete : function(){
            parent.parent.location.reload();
            parent.parent.GB_hide();
        }
    });
}

window.addEventListener('load', init, false);

{% endblock %}

{% block header %}
{% endblock %}

{% block body %}

<div id="content">
  
    <p>* は必須項目です。</p>
  
    <div id="edit-container">
        <table id="edit" class="contact-content">
            <tr>
                <td class="label" for="title">*タイトル:</td>
                <td><input type="text" id="contact-title" class="contact-input" name="title" tabindex="1001" /></td>
            </tr>
            <tr>
                <td class="label" for="published">公開する:</td>
                <td><input type="checkbox" id="contact-published" name="published" tabindex="1002" checked /></td>
		    </tr>
            <tr>
                <td class="label" for="lon">*経度:</td>
                <td><input type="text" id="contact-lon" class="contact-input" name="lon" tabindex="1003" /></td>
            </tr>
            <tr>
                <td class="label" for="lat">*緯度:</td>
                <td><input type="text" id="contact-lat" class="contact-input" name="lat" tabindex="1004" /></td>
            </tr>
            <tr>
                <td for="gmaps">&nbsp;</td>
                <td><div id="addMap" style="width: 400px; height: 250px;">&nbsp;</div></td>
            </tr>
            <tr>
                <td class="label" for="message">メモ:</td>
                <td><textarea id="contact-memo" class="contact-input" name="memo" cols="40" rows="2" tabindex="1005"></textarea>
            </tr>
        </table>
            
        <div style="margin-left:100px;">
            <input type="submit" id="regist" value="作成" tabindex="1006" />
        </div>
    </div>
</div>

{% endblock %}

{% block footer %}
{% endblock %}